package com.linzh.commonbase.mapper;

import com.linzh.commonbase.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("select * from sys_user where user_name = #{user_nama}")
    User findByUserName(String user_name);
    @Insert("insert into sys_user(user_name,password,tel,email,state,create_time) values(#{user_name},#{password},#{tel},#{email},1,now())")
    int addUser(User user);

    @Delete("delete from sys_user where id = #{id}")
    int delUser(int id);

    @Update("update sys_user set state = 0,update_time = now() where id = #{id}")
    int freezeUser(int id);
    @Select("select * from sys_user")
    List<User> findUserList();
}
